<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="button" value="打开窗口" onclick="openwin()">
    <input type="button" value="调整窗口位置和大小" onclick="changewin()">
    <script>
        var mywindow;
        function openwin(){
            mywindow = window.open('','newwin','width=250,height=300');
            getpossize();
        }
        function changewin(){
            mywindow.moveby(250,250);
            mywindow.focus();
            mywindow.resizeto(500,350);
            getpossize();
        }
        function getpossize(){
            var x = mywindow.screenLeft,y = mywindow.screentop;
            var inh = mywindow.innerHeight,inw = mywindow.innerwidth;
            var outh = mywindow.outerHeight,outW = mywindow.outerwidth;
            mywindow.document.write('<p>相对屏幕窗口的坐标:('+x+','+'y'+')</p>');
            mywindow.document.write('<p>文档的高度和宽度:'+inh+','+inw+'</p>');
            mywindow.document.write('<p>窗口的高度和宽度:'+outh+','+outw+'</p><hr>');
        }
    </script>
</body>
</html>